package com.springcloud.service.impl;

import com.springcloud.pojo.Dept;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.springcloud.dao.DeptDao;
import com.springcloud.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: spring_cloud_demo
 * @Package: com.com.springcloud.service.impl
 * @ClassName: DeptServiceImpl
 * @Author:
 * @Description:
 * @Date: 2020/10/13 9:08
 * @Version: 1.0
 */
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao deptDao;

    @Override
    public boolean addDept(Dept dept) {
       return deptDao.addDept(dept);
    }

    @Override
    public List<Dept> QueryAll() {
        return deptDao.QueryAll();
    }

    @Override
    public Dept getById(Long id) {
        return deptDao.selectOne(new QueryWrapper<Dept>().eq("deptno",id));
    }

}
